#include "control.h"
#include "ui_control.h"

Control::Control(std::shared_ptr<Driver> driver, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Control),
    driver_(std::move(driver))
{
    ui->setupUi(this);

    QObject::connect(ui->start_stop_button, SIGNAL(clicked()), this, SLOT(startStop()));
}

Control::~Control()
{
    delete ui;
}

void Control::startStop()
{
    if (driver_->status_ == DriverStatus::STOPPED)
        driver_->status_ = DriverStatus::RUNNABLE;
    else 
        driver_->status_ = DriverStatus::STOPPED;
}

